{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "uen=200;"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "bsloc=[[-12.994,-4.752],[12.915,-24.941]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "tdelay=pd.read_csv('tdelay.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [],
   "source": [
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "c=3*10e8"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [],
   "source": [
    "t=tdelay*10e-9"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [],
   "source": [
    "r=tdelay*0.3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>bs1</th>\n",
       "      <th>bs2</th>\n",
       "      <th>bs3</th>\n",
       "      <th>bs4</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>40.2783</td>\n",
       "      <td>71.9304</td>\n",
       "      <td>29.1597</td>\n",
       "      <td>54.6180</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>74.2308</td>\n",
       "      <td>83.9184</td>\n",
       "      <td>90.7815</td>\n",
       "      <td>49.6182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>101.4561</td>\n",
       "      <td>130.8990</td>\n",
       "      <td>76.3530</td>\n",
       "      <td>102.0135</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>52.2387</td>\n",
       "      <td>63.3477</td>\n",
       "      <td>86.1006</td>\n",
       "      <td>52.1301</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>64.6587</td>\n",
       "      <td>77.0607</td>\n",
       "      <td>94.1763</td>\n",
       "      <td>49.0998</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>53.5401</td>\n",
       "      <td>71.3616</td>\n",
       "      <td>57.3249</td>\n",
       "      <td>83.3007</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>72.4755</td>\n",
       "      <td>65.5779</td>\n",
       "      <td>92.6124</td>\n",
       "      <td>52.0002</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>108.0384</td>\n",
       "      <td>92.5191</td>\n",
       "      <td>130.5825</td>\n",
       "      <td>80.9535</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>98.8263</td>\n",
       "      <td>112.1931</td>\n",
       "      <td>100.5327</td>\n",
       "      <td>78.8331</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>82.8735</td>\n",
       "      <td>88.8627</td>\n",
       "      <td>87.4455</td>\n",
       "      <td>99.7911</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>76.4940</td>\n",
       "      <td>109.7967</td>\n",
       "      <td>51.7668</td>\n",
       "      <td>92.5941</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>50.8929</td>\n",
       "      <td>55.6719</td>\n",
       "      <td>68.7102</td>\n",
       "      <td>28.9671</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>67.1211</td>\n",
       "      <td>73.5750</td>\n",
       "      <td>74.3796</td>\n",
       "      <td>51.1296</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>51.7446</td>\n",
       "      <td>15.2811</td>\n",
       "      <td>75.7128</td>\n",
       "      <td>48.5157</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>80.4633</td>\n",
       "      <td>45.4170</td>\n",
       "      <td>104.5413</td>\n",
       "      <td>75.0258</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>53.0622</td>\n",
       "      <td>76.0326</td>\n",
       "      <td>32.0241</td>\n",
       "      <td>63.7215</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>67.5846</td>\n",
       "      <td>34.6239</td>\n",
       "      <td>95.4525</td>\n",
       "      <td>65.0190</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>52.9617</td>\n",
       "      <td>80.2272</td>\n",
       "      <td>52.8033</td>\n",
       "      <td>40.5024</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>66.2088</td>\n",
       "      <td>61.8267</td>\n",
       "      <td>79.0245</td>\n",
       "      <td>43.1733</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>41.4834</td>\n",
       "      <td>23.6073</td>\n",
       "      <td>71.0400</td>\n",
       "      <td>31.3365</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>33.7140</td>\n",
       "      <td>42.8766</td>\n",
       "      <td>42.9627</td>\n",
       "      <td>59.2092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>55.4448</td>\n",
       "      <td>79.6419</td>\n",
       "      <td>59.8281</td>\n",
       "      <td>74.6283</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>80.8911</td>\n",
       "      <td>52.0461</td>\n",
       "      <td>101.6508</td>\n",
       "      <td>69.6678</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>81.4461</td>\n",
       "      <td>107.0550</td>\n",
       "      <td>59.4450</td>\n",
       "      <td>90.8430</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>80.5767</td>\n",
       "      <td>91.5501</td>\n",
       "      <td>82.5924</td>\n",
       "      <td>49.9023</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>67.2690</td>\n",
       "      <td>99.9108</td>\n",
       "      <td>46.9464</td>\n",
       "      <td>96.0051</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>57.8838</td>\n",
       "      <td>72.9033</td>\n",
       "      <td>83.9580</td>\n",
       "      <td>43.5273</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>50.9187</td>\n",
       "      <td>66.0261</td>\n",
       "      <td>72.0195</td>\n",
       "      <td>77.9025</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>61.2822</td>\n",
       "      <td>83.8245</td>\n",
       "      <td>70.8483</td>\n",
       "      <td>45.6171</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>118.2897</td>\n",
       "      <td>86.0295</td>\n",
       "      <td>151.3332</td>\n",
       "      <td>120.6513</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>170</th>\n",
       "      <td>27.8328</td>\n",
       "      <td>60.8478</td>\n",
       "      <td>21.7509</td>\n",
       "      <td>47.8809</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>171</th>\n",
       "      <td>92.4060</td>\n",
       "      <td>114.4818</td>\n",
       "      <td>97.4520</td>\n",
       "      <td>77.2605</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>172</th>\n",
       "      <td>100.3713</td>\n",
       "      <td>133.7574</td>\n",
       "      <td>80.6844</td>\n",
       "      <td>103.6614</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>173</th>\n",
       "      <td>56.2593</td>\n",
       "      <td>40.0407</td>\n",
       "      <td>76.6365</td>\n",
       "      <td>41.8236</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>174</th>\n",
       "      <td>74.0742</td>\n",
       "      <td>46.7907</td>\n",
       "      <td>103.2534</td>\n",
       "      <td>66.6132</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>175</th>\n",
       "      <td>92.5383</td>\n",
       "      <td>108.9513</td>\n",
       "      <td>90.4632</td>\n",
       "      <td>67.4643</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>176</th>\n",
       "      <td>60.4824</td>\n",
       "      <td>93.3393</td>\n",
       "      <td>83.6508</td>\n",
       "      <td>72.2112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>177</th>\n",
       "      <td>75.0300</td>\n",
       "      <td>75.2556</td>\n",
       "      <td>100.0353</td>\n",
       "      <td>61.2381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>178</th>\n",
       "      <td>70.5174</td>\n",
       "      <td>49.2324</td>\n",
       "      <td>100.2579</td>\n",
       "      <td>68.3328</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>106.2393</td>\n",
       "      <td>78.0150</td>\n",
       "      <td>125.0691</td>\n",
       "      <td>114.4092</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>91.9488</td>\n",
       "      <td>125.3718</td>\n",
       "      <td>72.2736</td>\n",
       "      <td>100.5321</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>92.8872</td>\n",
       "      <td>55.0059</td>\n",
       "      <td>120.1323</td>\n",
       "      <td>102.2637</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>87.5631</td>\n",
       "      <td>111.1779</td>\n",
       "      <td>71.3871</td>\n",
       "      <td>113.0829</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>82.8465</td>\n",
       "      <td>97.1850</td>\n",
       "      <td>96.3636</td>\n",
       "      <td>57.4182</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>184</th>\n",
       "      <td>109.6254</td>\n",
       "      <td>68.6322</td>\n",
       "      <td>128.5551</td>\n",
       "      <td>97.5924</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>185</th>\n",
       "      <td>102.2040</td>\n",
       "      <td>72.8304</td>\n",
       "      <td>130.9719</td>\n",
       "      <td>106.7946</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>186</th>\n",
       "      <td>96.8352</td>\n",
       "      <td>73.2861</td>\n",
       "      <td>125.4078</td>\n",
       "      <td>91.5381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>187</th>\n",
       "      <td>70.9644</td>\n",
       "      <td>47.2293</td>\n",
       "      <td>105.2472</td>\n",
       "      <td>71.6487</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>188</th>\n",
       "      <td>34.5225</td>\n",
       "      <td>58.8336</td>\n",
       "      <td>39.9378</td>\n",
       "      <td>20.1636</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>189</th>\n",
       "      <td>81.5169</td>\n",
       "      <td>77.7510</td>\n",
       "      <td>87.0885</td>\n",
       "      <td>95.5269</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>190</th>\n",
       "      <td>50.5287</td>\n",
       "      <td>74.9856</td>\n",
       "      <td>64.8618</td>\n",
       "      <td>43.5528</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>191</th>\n",
       "      <td>99.4788</td>\n",
       "      <td>127.2603</td>\n",
       "      <td>90.5712</td>\n",
       "      <td>92.1390</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>192</th>\n",
       "      <td>54.9219</td>\n",
       "      <td>51.3384</td>\n",
       "      <td>76.2267</td>\n",
       "      <td>74.9640</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>193</th>\n",
       "      <td>29.8356</td>\n",
       "      <td>60.7230</td>\n",
       "      <td>32.7906</td>\n",
       "      <td>31.5129</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>194</th>\n",
       "      <td>38.4924</td>\n",
       "      <td>63.2463</td>\n",
       "      <td>10.9479</td>\n",
       "      <td>48.0246</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>195</th>\n",
       "      <td>88.3302</td>\n",
       "      <td>68.2947</td>\n",
       "      <td>114.7290</td>\n",
       "      <td>99.8637</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>196</th>\n",
       "      <td>84.0897</td>\n",
       "      <td>72.4410</td>\n",
       "      <td>99.6822</td>\n",
       "      <td>60.2511</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>63.1272</td>\n",
       "      <td>43.0575</td>\n",
       "      <td>97.3479</td>\n",
       "      <td>51.3828</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>198</th>\n",
       "      <td>58.2654</td>\n",
       "      <td>35.4624</td>\n",
       "      <td>87.5445</td>\n",
       "      <td>57.2436</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>199</th>\n",
       "      <td>27.1833</td>\n",
       "      <td>30.5127</td>\n",
       "      <td>55.2936</td>\n",
       "      <td>21.6315</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>200 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "          bs1       bs2       bs3       bs4\n",
       "0     40.2783   71.9304   29.1597   54.6180\n",
       "1     74.2308   83.9184   90.7815   49.6182\n",
       "2    101.4561  130.8990   76.3530  102.0135\n",
       "3     52.2387   63.3477   86.1006   52.1301\n",
       "4     64.6587   77.0607   94.1763   49.0998\n",
       "5     53.5401   71.3616   57.3249   83.3007\n",
       "6     72.4755   65.5779   92.6124   52.0002\n",
       "7    108.0384   92.5191  130.5825   80.9535\n",
       "8     98.8263  112.1931  100.5327   78.8331\n",
       "9     82.8735   88.8627   87.4455   99.7911\n",
       "10    76.4940  109.7967   51.7668   92.5941\n",
       "11    50.8929   55.6719   68.7102   28.9671\n",
       "12    67.1211   73.5750   74.3796   51.1296\n",
       "13    51.7446   15.2811   75.7128   48.5157\n",
       "14    80.4633   45.4170  104.5413   75.0258\n",
       "15    53.0622   76.0326   32.0241   63.7215\n",
       "16    67.5846   34.6239   95.4525   65.0190\n",
       "17    52.9617   80.2272   52.8033   40.5024\n",
       "18    66.2088   61.8267   79.0245   43.1733\n",
       "19    41.4834   23.6073   71.0400   31.3365\n",
       "20    33.7140   42.8766   42.9627   59.2092\n",
       "21    55.4448   79.6419   59.8281   74.6283\n",
       "22    80.8911   52.0461  101.6508   69.6678\n",
       "23    81.4461  107.0550   59.4450   90.8430\n",
       "24    80.5767   91.5501   82.5924   49.9023\n",
       "25    67.2690   99.9108   46.9464   96.0051\n",
       "26    57.8838   72.9033   83.9580   43.5273\n",
       "27    50.9187   66.0261   72.0195   77.9025\n",
       "28    61.2822   83.8245   70.8483   45.6171\n",
       "29   118.2897   86.0295  151.3332  120.6513\n",
       "..        ...       ...       ...       ...\n",
       "170   27.8328   60.8478   21.7509   47.8809\n",
       "171   92.4060  114.4818   97.4520   77.2605\n",
       "172  100.3713  133.7574   80.6844  103.6614\n",
       "173   56.2593   40.0407   76.6365   41.8236\n",
       "174   74.0742   46.7907  103.2534   66.6132\n",
       "175   92.5383  108.9513   90.4632   67.4643\n",
       "176   60.4824   93.3393   83.6508   72.2112\n",
       "177   75.0300   75.2556  100.0353   61.2381\n",
       "178   70.5174   49.2324  100.2579   68.3328\n",
       "179  106.2393   78.0150  125.0691  114.4092\n",
       "180   91.9488  125.3718   72.2736  100.5321\n",
       "181   92.8872   55.0059  120.1323  102.2637\n",
       "182   87.5631  111.1779   71.3871  113.0829\n",
       "183   82.8465   97.1850   96.3636   57.4182\n",
       "184  109.6254   68.6322  128.5551   97.5924\n",
       "185  102.2040   72.8304  130.9719  106.7946\n",
       "186   96.8352   73.2861  125.4078   91.5381\n",
       "187   70.9644   47.2293  105.2472   71.6487\n",
       "188   34.5225   58.8336   39.9378   20.1636\n",
       "189   81.5169   77.7510   87.0885   95.5269\n",
       "190   50.5287   74.9856   64.8618   43.5528\n",
       "191   99.4788  127.2603   90.5712   92.1390\n",
       "192   54.9219   51.3384   76.2267   74.9640\n",
       "193   29.8356   60.7230   32.7906   31.5129\n",
       "194   38.4924   63.2463   10.9479   48.0246\n",
       "195   88.3302   68.2947  114.7290   99.8637\n",
       "196   84.0897   72.4410   99.6822   60.2511\n",
       "197   63.1272   43.0575   97.3479   51.3828\n",
       "198   58.2654   35.4624   87.5445   57.2436\n",
       "199   27.1833   30.5127   55.2936   21.6315\n",
       "\n",
       "[200 rows x 4 columns]"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARMAAAD8CAYAAABUzEBbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAADtJJREFUeJzt3W2sZWV5xvH/1UFMOiUVZXiRF0vqBINNmerJWEPaiC8IxDrSYDt8sFRJxhpJatoPYk3U6Be1WpKK1YxKpI2C1had6AiM1ARNqjJDBgWBMlJaDjNhRBQ0WsnYux/2OnR72GfezvOcc/bx/0t29np51jr3zs5cs9Zea+87VYUkLdavLXcBklYHw0RSE4aJpCYME0lNGCaSmjBMJDXRJEySXJNkf5I7x5Y9M8mOJPcNz8cvsO1lw5j7klzWoh5JS6/VkckngQvmLbsSuKWq1gO3DPO/JMkzgXcCLwI2Au9cKHQkrWxNwqSqbgUenbd4E3DtMH0t8JoJm74S2FFVj1bVD4EdPDWUJE2BYzru+6Sq2gdQVfuSnDhhzKnAg2Pzs8Oyp0iyBdgCsHbt2hc+73nPa1yupDm7du16pKrWHck2PcPkcGTCson391fVVmArwMzMTO3cubNnXdKvtCT/daTb9Lya83CSUwCG5/0TxswCp4/Nnwbs7ViTpE56hsk2YO7qzGXAFyaMuQk4P8nxwwev5w/LJE2ZVpeGrwP+HTgryWySy4H3Aq9Ich/wimGeJDNJPg5QVY8C7wFuGx7vHpZJmjKZxp8g8DMTqa8ku6pq5ki28Q5YSU0YJpKaMEwkNWGYSGrCMJHUhGEiqQnDRFIThomkJgwTSU0YJpKaMEwkNWGYSGrCMJHUhGEiqQnDRFIThomkJgwT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NpD7sfb6SW1sBpOcyStAIaJpCYME0lNGCaSmjBMJDVhmEhqwjCR1MT/ARhgRPX1LIALAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "boxa = 10\n",
    "\n",
    "\n",
    "# 创建一个新的图形\n",
    "fig, ax = plt.subplots()\n",
    "# 设置坐标轴的范围\n",
    "ax.set_xlim(-boxa, boxa)\n",
    "ax.set_ylim(-boxa, boxa)\n",
    "# 设置坐标轴等比例显示\n",
    "ax.set_aspect('equal')\n",
    "\n",
    "for i in range(10):\n",
    "    # 创建一个圆形，中心位于(0, 0)，半径为5\n",
    "    circle = plt.Circle((bsloc[0]), r['bs1'][i], edgecolor='b', facecolor='none')\n",
    "    # 添加圆形到图形中\n",
    "    ax.add_artist(circle)\n",
    "    # 创建一个圆形，中心位于(0, 0)，半径为5\n",
    "    circle = plt.Circle((bsloc[1]), r['bs2'][i], edgecolor='b', facecolor='none')\n",
    "    # 添加圆形到图形中\n",
    "    ax.add_artist(circle)\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "# 显示图形\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[12.915, -24.941]"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "bsloc[1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [],
   "source": [
    "tdelay7=pd.read_csv('tdelay7.csv')\n",
    "tdelay7np = np.array(tdelay7)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  6.572, -24.373,   0.798,   0.   ],\n",
       "       [-59.227, -13.774, -22.141,   0.   ],\n",
       "       [ -7.937,  16.387, -28.543,   0.   ],\n",
       "       [ -5.107,  -7.793, -22.009,   0.   ],\n",
       "       [ -6.999, -38.332, -29.037,   0.   ],\n",
       "       [ 33.391,  34.899,   7.706,   0.   ],\n",
       "       [-44.272, -27.499, -21.841,   0.   ]])"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time_diffs = tdelay7np - tdelay7np[:, 3].reshape(-1, 1)\n",
    "time_diffs"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[  1.9716,  -7.3119,   0.2394,   0.    ],\n",
       "       [-17.7681,  -4.1322,  -6.6423,   0.    ],\n",
       "       [ -2.3811,   4.9161,  -8.5629,   0.    ],\n",
       "       [ -1.5321,  -2.3379,  -6.6027,   0.    ],\n",
       "       [ -2.0997, -11.4996,  -8.7111,   0.    ],\n",
       "       [ 10.0173,  10.4697,   2.3118,   0.    ],\n",
       "       [-13.2816,  -8.2497,  -6.5523,   0.    ]])"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "r_diffs=time_diffs*0.3\n",
    "r_diffs\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3.0"
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "10*0.3\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Estimated UEs positions: [(66.06016142563634, -30.40724945763635), (-86.46563410854549, -108.65985042745471), (-101.14118213236368, 277.63881606836355), (10.078553690181698, 134.14671867781826), (43.896926554363624, 27.338389157636332), (-13.295656137272818, 237.86809476727248), (-22.52346998400005, -110.34912462199985)]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "def calculate_distance(time_ns):\n",
    "    \"\"\"Convert ToA to distance using the speed of light.\"\"\"\n",
    "    speed_of_light = 3e8  # meters per second\n",
    "    return time_ns * speed_of_light / 1e9\n",
    "\n",
    "def trilaterate(pos1, pos2, pos3, d1, d2, d3):\n",
    "    \"\"\"Calculate the intersection of three spheres given their centers and radii.\"\"\"\n",
    "    x1, y1 = pos1\n",
    "    x2, y2 = pos2\n",
    "    x3, y3 = pos3\n",
    "    \n",
    "    # Calculate differences between pairs of centers\n",
    "    A = x2 - x1\n",
    "    B = y2 - y1\n",
    "    C = x3 - x1\n",
    "    D = y3 - y1\n",
    "    \n",
    "    # Calculate squares of distances between centers\n",
    "    E = (d1**2 - d2**2 + A**2 + B**2)\n",
    "    F = (d1**2 - d3**2 + C**2 + D**2)\n",
    "    \n",
    "    # Solve for the unknown coordinates\n",
    "    det = A*D - B*C\n",
    "    if abs(det) < 1e-9:\n",
    "        raise ValueError(\"The three circles do not intersect at a unique point.\")\n",
    "    \n",
    "    px = (D*E - B*F) / det\n",
    "    py = (A*F - C*E) / det\n",
    "    \n",
    "    return px, py\n",
    "\n",
    "# Given data\n",
    "n = 7\n",
    "bs1 = (-5, -5)\n",
    "bs2 = (7, -4)\n",
    "\n",
    "\n",
    "tdelay7=pd.read_csv('tdelay7.csv')\n",
    "# Convert ToA to distances for each UE\n",
    "toas = np.array(tdelay7)\n",
    "distances = [[calculate_distance(toa) for toa in row] for row in toas]\n",
    "\n",
    "# Estimate the positions of UEs\n",
    "ues_positions = []\n",
    "for dists in distances:\n",
    "    ue_pos = trilaterate(bs1, bs2, (0, 0), dists[0], dists[1], dists[2])\n",
    "    ues_positions.append(ue_pos)\n",
    "\n",
    "# Estimate the positions of the remaining BSs\n",
    "# This part would involve using the estimated UE positions and their distances to the unknown BSs.\n",
    "# Since we don't have the positions of the last two BSs, we would need to use an optimization approach\n",
    "# or additional constraints to estimate their positions based on the UE positions and distances.\n",
    "\n",
    "print(\"Estimated UEs positions:\", ues_positions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[[37.8897, 28.6062, 36.1575, 35.9181],\n",
       " [40.529399999999995, 54.1653, 51.65520000000001, 58.2975],\n",
       " [70.4247, 77.7219, 64.2429, 72.8058],\n",
       " [68.7135, 67.9077, 63.6429, 70.2456],\n",
       " [26.460899999999995, 17.061, 19.8495, 28.560600000000004],\n",
       " [73.4694, 73.9218, 65.7639, 63.4521],\n",
       " [49.7139, 54.7458, 56.4432, 62.99550000000001]]"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "distances"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [],
   "source": [
    "a=(-5, -5) \n",
    "b=(7, -4)\n",
    "c=(-2, 3) \n",
    "d=(7, 9)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "metadata": {},
   "outputs": [],
   "source": [
    "ue1=(5, -4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 110,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARMAAAD8CAYAAABUzEBbAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvhp/UCwAAEPNJREFUeJzt3X2wlOV9xvHvVcBgqSO+gB4RU20YrSaK5gypYdr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N/N2SMZb90vlV29T+BO4Hoq7+F64Cbg64NXXVJt99k0YXJEdEsaCyyX9Hrx//CfWqUKk4y37pdKf9+npB8AP8tcTk5t99n0V0R0F4+bJC2kckg3lMLkTUkdEdEjqQPYtLsnDIXDnN3eut9Oig+uz7lUTjy3q+eACcWPYO1F5UT5ohbXNGCSRknap28ZmEJ7f071LKLyFRfo51ddSrVnsiuSzgVuA8ZQuXV/dUScERGvSOq7db+Xqlv329T3JE2kcjjwBnBpa8vZcxHRK+lyYBkwDFhQfNWi3R0ELKz8JA/DgZ9GxKOtLWnPSboHOAk4sPh6zLXADcD9ki4B/he4YLev49vpzSyFoXCYY2Yl4DAxsyQcJmaWhMPEzJJwmJhZEg4TM0vCYWJmSfw/ZvXvcs/du8MAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "boxa = 10\n",
    "\n",
    "\n",
    "# 创建一个新的图形\n",
    "fig, ax = plt.subplots()\n",
    "# 设置坐标轴的范围\n",
    "ax.set_xlim(-boxa, boxa)\n",
    "ax.set_ylim(-boxa, boxa)\n",
    "# 设置坐标轴等比例显示\n",
    "ax.set_aspect('equal')\n",
    "\n",
    "\n",
    "plt.scatter(a[0],a[1]);\n",
    "plt.scatter(b[0],b[1]);\n",
    "plt.scatter(c[0],c[1]);\n",
    "plt.scatter(d[0],d[1]);\n",
    "\n",
    "plt.scatter(ue1[0],ue1[1],'x');\n",
    "\n",
    "# 显示图形\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 108,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(-5, -5)"
      ]
     },
     "execution_count": 108,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
